<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%String path = request.getContextPath() ;%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>征信信息</title>
<jsp:include page="../../import.jsp" flush="true" />
</head>

<body class="iframeBody">
    <div class="Wrapper">
        <div class="sqPanel">
            <div class="sqPanel_head inL">
                <div class="btnsBox inLC">
                    <!-- <span id="cust_cst_np_bank_acc_add_btn_id" class="sq-button sq-button-hasicon"><i class="sqBtnIco_3"></i>添加</span> -->
                </div>
                <span>在我司融资情况</span>
            </div>
            <div class="sqPanel_body">
                <div id="cstCreditGrid" class="sq-grid"></div>
            </div>
        </div>
    </div>
 	<!-- hide data -->
	<div class="fieldBox col_100" style="display:none;">
		<div class="field">
		    <input name=cstId id="cstId" type="text" class="ui-textbox" value="${cstId}">
		</div>
	</div>

    <script>
    $(function() {
    	initForm();
    	initGrid();
        initEvent();
    });
    
    //初始化Form
    function initForm(){
    }
    
    //初始化列表
    function initGrid(){
    	var _cstId = $("#cstId").val();

        $("#cstCreditGrid").ligerGrid({
            usePager: false,
            url: "<%=path%>/customer/cstbscinfo/initCstCreditList.do?cstId="+_cstId,
            method : 'get',
            columns: [{
                display: '融资时间',
                name: 'prjCrtTm',
                width: 150,
                align:'center',
                render:renderDate
            }, {
                display: '融资台数',
                name: 'prdQty',
                width: 150,
                align:'center'
            }, {
                display: '融资金额(元)',
                name: 'contAmt',
                minWidth: 200,
                align:'center',
                render:function(rowdata,index,value){
                    return '&yen;' + FormatMoney(rowdata.contAmt/100);
                },totalSummary: {
                    render: function (suminf, column, cell) {
                        //return '<div class="c_red">&yen; ' + SQ.utils.currencyFormatter(suminf.sum, 2) + '</div>';
                    	return '<div class="c_red">&yen; ' + FormatMoney(suminf.sum/100) + '</div>';
                    }
                }

            }, {
                display: '合同号',
                name: 'lsCntNo',
                minWidth: 200,
                align:'center'
            }, {
                display: '逾期天数',
                name: 'overdueDay',
                align:'center',
                minWidth: 200
            }, {
                display: '逾期租金(元)',
                name: 'overdueAmount',
                width: 200,
                render:function(rowdata,index,value){
                    return '&yen;' + FormatMoney(rowdata.overdueAmount/100);
                },totalSummary: {
                    render: function (suminf, column, cell) {
                        //return '<div class="c_red">&yen; ' + SQ.utils.currencyFormatter(suminf.sum, 2) + '</div>';
                    	return '<div class="c_red">&yen; ' + FormatMoney(suminf.sum/100) + '</div>';
                    }
                }
            }, {
                display: '罚息金总额(元)',
                name: 'penaltyAmount',
                minWidth: 200,
                align:'center',
                render:function(rowdata,index,value){
                    return '&yen;' + FormatMoney(rowdata.penaltyAmount/100);
                },totalSummary: {
                    render: function (suminf, column, cell) {
                        //return '<div class="c_red">&yen; ' + SQ.utils.currencyFormatter(suminf.sum, 2) + '</div>';
                    	return '<div class="c_red">&yen; ' + FormatMoney(suminf.sum/100) + '</div>';
                    }
                }
            }/* , {
                display: '应收总金额(元)',
                name: 'feeAmt',
                minWidth: 200,
                render:function(rowdata,index,value){
                    return '&yen;' + FormatMoney(rowdata.feeAmt/100);
                },totalSummary: {
                    render: function (suminf, column, cell) {
                        //return '<div class="c_red">&yen; ' + SQ.utils.currencyFormatter(suminf.sum, 2) + '</div>';
                    	return '<div class="c_red">&yen; ' + FormatMoney(suminf.sum/100) + '</div>';
                    }
                }
            } */,getGridOperColumnContent()],
            width: '100%',
            height:'100%',
			heightDiff:-2,
            root:'rows',
	        record:'total',
            rownumbers: true,
            fixedCellHeight: false,
            usePagerOnLessPagesize: false,
            onAfterShowData: function(currentData) {
                SetIframe_height();
                $(".liger_tip").ligerTip();
            }
        });

        cstCreditGrid = liger.get("cstCreditGrid");
        cstCreditGrid.setHeight(100);
        cstCreditGrid.options.isSingleCheck=true;
    }
    
    //初始化事件
    function initEvent(){
    	
    }
    
    //获取Grid操作列内容
    function getGridOperColumnContent(){
    	 var data = {
           
    	 }
    	return data;
    }
    
    //格式化时间
	function renderDate(rowdata, index, value){
		var dateStr = "";
		if(null != value){
			var date = new Date(value);
			dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
		}
		return dateStr;
	}
   
    </script>
</body>

</html>
